﻿using blackhouse.BlackApart.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace blackhouse.BlackApart.Business.Reservations {
    public class ApartmentWebReservation {

        #region Fields

        private IWebReservation reservation;
        private ApartmentWebReservationData data;

        #endregion

        #region Properties

        public int RecordId {
            get { return this.data.RecordId; }
            set { this.data.RecordId = value; }
        }
        public int ApartmentId { get { return this.data.ApartmentId; } }
        public int PeopleCount { get { return this.data.PeopleCount; } }
        public double Price { get { return this.data.Price; } }
        public double FinalPrice {
            get {
                return this.Price * (1 + this.reservation.Rabat / 100);
            }
        }

        #endregion

        #region Constructors

        internal ApartmentWebReservation(IWebReservation associaciedReservation, int apartmentId, int peoples) {
            this.reservation = associaciedReservation;
            ApartmentWebReservationData d = new ApartmentWebReservationData();
            d.ApartmentId = apartmentId;
            d.PeopleCount = peoples;
            this.data = d;
        }

        internal ApartmentWebReservation(IWebReservation associaciedReservation, ApartmentWebReservationData reservationData) {
            this.reservation = associaciedReservation;
            this.data = reservationData;
        }

        #endregion

    }
}
